package com.dy.nygl.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import com.dy.nygl.pojo.MachineAlerts;
import com.dy.nygl.service.MachineAlertsService;

@Controller
@RequestMapping("/machineAlerts")
public class MachineAlertsController {
	
	@Resource(name="machineAlertsService")
	private MachineAlertsService machineAlertsService;
	
	@RequestMapping("/selectMachineAlerts.action")
	public ModelAndView selectMachineAlerts(){
		List<MachineAlerts> selectMachine = machineAlertsService.selectMachineAlerts();
		ModelAndView model = new ModelAndView();
		model.addObject("selectMachine",selectMachine);
		model.setViewName("machineAlerts");
		return model;
	}
	
	@RequestMapping("/deleteMachineAlerts.action")
	public void deleteMachineAlerts(@RequestParam("MachineAlertsId")Integer id){
		machineAlertsService.deleteMachineAlertsOne(id);
	}
}
